home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 90 / CDMM_90_1.ISO / Cycling Manager 2 / CyclingManager2Demo.exe / Disk1 / data1.cab / Game / DataCM2 / scripts / elements / editbox.cnh < prev    next >
Encoding:
Text File  |  2002-05-10  |  31.3 KB  |  1,085 lines

  1. // Constants
  2. // Type Edit Box
  3. var i32x e_GUI_EditBox_All = 0;
  4. var i32x e_GUI_EditBox_CharOnly = 1;
  5. var i32x e_GUI_EditBox_Numeric = 2;
  6. var i32x e_GUI_EditBox_Chat = 3;
  7.  
  8. // Change EditBox
  9. var i32x e_GUI_EditBox_Change_True = 0;
  10. var i32x e_GUI_EditBox_Change_False = 1;
  11.  
  12. // editbox.cnh
  13. message SaveData(Gui_Component _pComponent, szx _szTxt, i32x _iChangeBox);
  14.  
  15.  
  16. // Standard editbox
  17. // Data class
  18. class Gui_dtEditBox
  19. {
  20.     var i32x    iCursor;            // cursor position
  21.     var i32x    iCursorEndSelect;    // cursor position at the end of selection
  22.     var i32x    iMaxChar;            // size edit box
  23.     var i32x    iType;                // All, char only, int only 
  24.     var szx        szTxt;                // edit box contains this text
  25.     var boolx    bClick;                // true if click down, false if click up
  26.     var boolx    bInsert;            // if insert mode
  27.     var boolx    bWrite;                // write or not
  28.     var boolx    bShift;                // true if key down = shift
  29. };
  30.  
  31. class Gui_dtEditBoxComposite
  32. {
  33.     var Gui_Component        gcEditBox;    // edit box
  34.     var Gui_Component        gcCursor;        // cursor
  35.     var Gui_Component        gcTexture;    // background texture
  36.     var i32x                iLenghtCursor;    // cursor size
  37.     var i32x                iHeightCursor;    // cursor height
  38.     var i32x                iHAlign;            // Default Horizontal align
  39.     var i32x                iVAlign;            // Default vertical align
  40.     var i32x                iFocused;            // Cursor shown ?
  41.     var f32x                fFontFactor;    // factor font size
  42. };
  43.  
  44. // Message
  45. // edit box
  46. message EbText(szx _szTxt);
  47. message EbChangeType(i32x _iType);
  48. message EbNbCharAccepted(i32x _iSize);
  49. message EbResize(i32x _iX, i32x _iY);
  50.  
  51. // edit box composite
  52. message EbCText(szx _szTxt);
  53. message EbCChangeType(i32x _iType);
  54. message EbCNbCharAccepted(i32x _iSize);
  55. message EbCClick(i32x _iX,i32x _iY,i32x _iButton);
  56. message EbCDblClick();
  57. message EbCLoseFocus();
  58. message EbCGainFocus();
  59. message EbCMoveCursor(i32x _iCase);
  60. message EbCMoveCursorSelect(i32x _iCase);
  61. message EbCMouseMove(i32x _iX, i32x _iY);
  62. message EbCSaveData(szx _szTxt, i32x _iChangeBox);
  63. message EbCResize(i32x _iX, i32x _iY);
  64. message EbCAlign(i32x _eHAlign, i32x _eVAlign);
  65. message EbCChangeColor(i32x _iColor);
  66.  
  67. // Init func Predeclaration
  68. func Gui_Component NewEditBox(Menu_Material _pFont, i32x _iColor);
  69. func Gui_Component NewEditBoxExt(Menu_Material _pFont, i32x _iColor, f32x _fFontSize);
  70.  
  71. // Predeclaration
  72. // event edit box
  73. func i32x EditBox_OnMouseClick(i32x _iX,i32x _iY,i32x _iButton);
  74. func void EditBox_OnKeyDown(i32x _iKey, i32x _iCount);
  75. func void EditBox_OnChar(szx _szChar,i32x _iCount);
  76. func i32x EditBox_OnLoseFocus();
  77. func i32x EditBox_OnGainFocus();
  78. func i32x EditBox_OnKeyUp(i32x _iKey);
  79. func i32x EditBox_OnMouseDown(i32x _iX,i32x _iY,i32x _iButton);
  80. func i32x EditBox_OnMouseUp(i32x _iX,i32x _iY,i32x _iButton);
  81. func i32x EditBox_OnMouseMove(i32x _iX,i32x _iY);
  82. func i32x EditBox_OnMouseDblClick(i32x _iX,i32x _iY,i32x _iButton);
  83.  
  84. // msg edit box
  85. func void EditBox_Text(szx _szTxt);
  86. func void EditBox_SetText(Gui_Component _pthis, Gui_dtEditBox _pdtEditBox, szx _szTxt);
  87. func szx  EditBox_GetText(Gui_Component _pComponent);
  88. func void EditBox_ChangeType(i32x _iType);
  89. func void EditBox_NbCharAccepted(i32x _iSize);
  90. func void EditBox_Resize(i32x _iX, i32x _iY);
  91.  
  92. // event edit box composite
  93. func void EditBoxComposite_OnClick(i32x _iX,i32x _iY,i32x _iButton);
  94. func void EditBoxComposite_OnLoseFocus();
  95. func void EditBoxComposite_MoveCursor(i32x _iCase);
  96. func void EditBoxComposite_MoveCursorSelect(i32x _iCase);
  97. func void EditBoxComposite_OnMouseMove(i32x _iX, i32x _iY);
  98. func void EditBoxComposite_OnGainFocus();
  99. func void EditBoxComposite_OnMouseDblClick();
  100. func void EditBoxComposite_OnEnable();
  101. func void EditBoxComposite_OnDisable();
  102.  
  103. // msg edit box composite
  104. func void EditBoxComposite_ChangeType(i32x _iType);
  105. func void EditBoxComposite_Resize(i32x _iX, i32x _iY);
  106. func void EditBoxComposite_NbCharAccepted(i32x _iSize);
  107. func void EditBoxComposite_Text(szx _szTxt);
  108. func void EditBoxComposite_SaveData(szx _szTxt, i32x _iChangeBox);
  109. func void EditBoxComposite_Align(i32x _eHAlign, i32x _eVAlign);
  110. func void EditBoxComposite_ChangeColor(i32x _iColor);
  111.  
  112.  
  113.  
  114. // Message handling interface
  115. interface Gui_iBitmapEditBox
  116. {
  117.     // Gui System Messages
  118.     EditBox_OnMouseMove        MouseMove;
  119.     EditBox_OnMouseDown        MouseDown;
  120.     EditBox_OnMouseUp        MouseUp;
  121.     EditBox_OnMouseClick    MouseClick;
  122.     EditBox_OnMouseDblClick    MouseDblClick;
  123.     EditBox_OnKeyDown        KeyDown;
  124.     EditBox_OnChar            Char;
  125.     EditBox_OnLoseFocus        LoseFocus;
  126.     EditBox_OnGainFocus        GainFocus;
  127.     EditBox_OnKeyUp            KeyUp;
  128.     EditBox_Text            EbText;            // write text in edit box
  129.     EditBox_ChangeType        EbChangeType;    // change edit box type
  130.     EditBox_NbCharAccepted    EbNbCharAccepted;        // change number of character accepted in edit box  
  131.     EditBox_Resize            EbResize; // change size of edit box 
  132. }
  133.  
  134. interface Gui_iEditBoxComposite
  135. {
  136.     // Gui System Messages
  137.     EditBoxComposite_OnEnable            Enable;
  138.     EditBoxComposite_OnDisable            Disable;
  139.  
  140.     EditBoxComposite_OnClick            EbCClick;
  141.     EditBoxComposite_OnMouseDblClick    EbCDblClick;
  142.     EditBoxComposite_OnLoseFocus        EbCLoseFocus;
  143.     EditBoxComposite_OnGainFocus        EbCGainFocus;
  144.     EditBoxComposite_Text                EbCText;        // write text in edit box
  145.     EditBoxComposite_ChangeType            EbCChangeType; // change edit box type
  146.     EditBoxComposite_NbCharAccepted        EbCNbCharAccepted;    // change number of character accepted in edit box 
  147.     EditBoxComposite_MoveCursor            EbCMoveCursor; // move cursor
  148.     EditBoxComposite_MoveCursorSelect    EbCMoveCursorSelect; // move cursor select
  149.     EditBoxComposite_OnMouseMove        EbCMouseMove;    
  150.     EditBoxComposite_SaveData            EbCSaveData; // save edit box data
  151.     EditBoxComposite_Resize                EbCResize; // change size of edit box 
  152.     EditBoxComposite_Align                EbCAlign; // change default align of edit box 
  153.     EditBoxComposite_ChangeColor        EbCChangeColor; // change edit box color
  154. }
  155.  
  156. /*
  157.  *    Function        : EditBox extented constructor 
  158.  *    Parameters        : _pMaterial material pointer, iColor : background color, fFontSize : font size
  159.  */
  160. func Gui_Component NewEditBoxExt(Menu_Material _pFont, i32x _iColor, f32x _fFontSize)
  161. {
  162.     var f32x factor;
  163.     var Menu_Sprite sprite;
  164.     var Gui_Component cursor,editbox,texture,composite;
  165.     var i32x iArea;
  166.     var i32x sx,sy;
  167.     var Gui_dtEditBox pdtEditBox;
  168.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  169.  
  170.     // Create an object that will contain Bitmap buton + caption
  171.     composite = NewObject(Gui_iEditBoxComposite);
  172.  
  173.     // Two component in composite edit box
  174.     SetComponentNumber(composite,2);
  175.  
  176.     // Create container with editbox interface
  177.     editbox = NewContainer(Gui_iBitmapEditBox);
  178.  
  179.     // Create a sprite with material and area index e_GUI_State_Enabled
  180.     sprite = NewSprite2D(_pFont);
  181.     iArea = e_GUI_State_Enabled;
  182.     SetArea(sprite,iArea);
  183.  
  184.     // Get size of Carriage Return  for editbox height
  185.     sx = 120.0*g_fScreenScaleFactor;
  186.  
  187.     //change font size
  188.     SetScale(editbox,_fFontSize*g_fScreenScaleFactor);
  189.     
  190.     // calcul editbox size
  191.     factor = (_fFontSize*g_fScreenScaleFactor) / 1.0;
  192.     sy = PrecalcTextHeight(sprite," ") * factor;
  193.  
  194.     // align
  195.     SetAlign(editbox,e_GUI_HAlign_Right,e_GUI_VAlign_Center);
  196.  
  197.     // Attach the sprite to this container
  198.     AttachSprite(editbox,sprite);
  199.  
  200.     // Tell Gui to clip this sprite to container size
  201.     Clip(editbox);
  202.  
  203.     // Affect data pointer
  204.     pdtEditBox = new Gui_dtEditBox;
  205.     pdtEditBox.bWrite = false;
  206.     pdtEditBox.bShift = false;
  207.     pdtEditBox.iCursor = 0;
  208.     pdtEditBox.iCursorEndSelect = 0;
  209.     pdtEditBox.iMaxChar = 20;
  210.     pdtEditBox.szTxt = "";
  211.     pdtEditBox.iType = e_GUI_EditBox_All;
  212.     SetData(editbox,pdtEditBox);
  213.  
  214.     // Create a cursor 
  215.     cursor = NewBitmap(smWhite,0);
  216.     SetAlign(cursor,e_GUI_HAlign_Zoom,e_GUI_VAlign_Zoom);
  217.     StretchTo(cursor,2,sy);
  218.  
  219.     // Disable cursor
  220.     cursor<<Disable();
  221.     cursor<<Hide();
  222.  
  223.     // Create background texture
  224.     texture = NewBitmap(smWhite,0);
  225.     Clip(texture);
  226.     SetShadingMode(GetSprite(texture),DLC_GouraudMode_ModulateDiffuse,DLC_GouraudMode_ModulateDiffuse);
  227.     SetBlendingMode(GetSprite(texture),DLC_Blend_AlphaBlend);
  228.     SetColor(texture,_iColor);
  229.     SetAlign(texture,e_GUI_HAlign_Zoom,e_GUI_VAlign_Zoom);
  230.     StretchTo(texture,sx ,sy+(2*g_fScreenScaleFactor));
  231.     // Disable texture
  232.     if(_iColor==0)
  233.     {
  234.         texture<<Hide();
  235.     }
  236.     texture<<Disable();
  237.  
  238.     // Mount containers into object
  239.     MountComponent(composite,texture);
  240.     MountComponent(composite,editbox);
  241.     MountComponent(composite,cursor);
  242.  
  243.     // Affect data pointer
  244.     pdtEditBoxComposite = new Gui_dtEditBoxComposite;
  245.     pdtEditBoxComposite.gcCursor = cursor;
  246.     pdtEditBoxComposite.gcEditBox = editbox;
  247.     pdtEditBoxComposite.gcTexture = texture;
  248.     pdtEditBoxComposite.iLenghtCursor = 2;
  249.     pdtEditBoxComposite.iHeightCursor = sy;
  250.     pdtEditBoxComposite.iHAlign = e_GUI_HAlign_Right;
  251.     pdtEditBoxComposite.iVAlign = e_GUI_VAlign_Center;
  252.     pdtEditBoxComposite.iFocused = 0;
  253.     pdtEditBoxComposite.fFontFactor = factor;
  254.     SetData(composite,pdtEditBoxComposite);
  255.  
  256.     // Strech edit box
  257.     sy = sy+(2*g_fScreenScaleFactor);
  258.     StretchTo(editbox,sx,sy);
  259.  
  260.     // Stretch composite to fit editbox
  261.     StretchTo(composite,sx,sy);
  262.  
  263.     return composite;
  264. }
  265.  
  266. /*
  267.  *    Function        : EditBox constructor with cursor
  268.  *    Parameters        : _pMaterial material pointer
  269.  */
  270. func Gui_Component NewEditBox(Menu_Material _pFont, i32x _iColor)
  271. {
  272.     var f32x fFontSize;
  273.  
  274.     fFontSize = 1.0/g_fScreenScaleFactor;
  275.  
  276.     return NewEditBoxExt(_pFont,_iColor,fFontSize);
  277. }
  278.  
  279.  
  280. ////////////////// EVENT EDIT BOX //////////////////////////////////
  281. /*
  282.  *    Function        : EditBox key up move callback
  283.  */
  284. func i32x EditBox_OnKeyUp(i32x _iKey) {
  285.     var Gui_Component pthis; 
  286.     var Gui_dtEditBox pdtEditBox;
  287.  
  288.     pthis = GetThis();
  289.     pdtEditBox = GetData(pthis);
  290.  
  291.     if (_iKey == VK_Shift)  // shift
  292.         pdtEditBox.bShift = false;    
  293.     pdtEditBox.bWrite = false;
  294. }
  295.  
  296. /*
  297.  *    Function        : EditBox Mouse move callback
  298.  *    Remarks            : test if click down
  299.  */
  300. func i32x EditBox_OnMouseMove(i32x _iX,i32x _iY) {
  301.     var Gui_Component pthis; 
  302.     var Gui_Component parent; 
  303.     var Gui_dtEditBox pdtEditBox;
  304.  
  305.     pthis = GetThis();
  306.     pdtEditBox = GetData(pthis);
  307.  
  308.     if (pdtEditBox.bClick==true) {
  309.         parent = GetParent(pthis);
  310.         parent<<EbCMouseMove(_iX,_iY);
  311.         return 1;
  312.     }
  313.     return 0;
  314. }
  315.  
  316. /*
  317.  *    Function        : EditBox Mouse down callback
  318.  *    Remarks            : test left click
  319.  */
  320. func i32x EditBox_OnMouseDown(i32x _iX,i32x _iY,i32x _iButton) {
  321.     var Gui_Component pthis; 
  322.     var Gui_dtEditBox pdtEditBox;
  323.  
  324.     if(_iButton == e_Gui_Mouse_Left_Button)
  325.     {
  326.         // msg click send to parent
  327.         pthis = GetThis();
  328.         pdtEditBox = GetData(pthis);
  329.         pdtEditBox.bClick = true;
  330.         pdtEditBox.iCursorEndSelect = pdtEditBox.iCursor;
  331.         return 1;
  332.     }
  333.     return 0;
  334. }
  335.  
  336. /*
  337.  *    Function        : EditBox Mouse up callback
  338.  */
  339. func i32x EditBox_OnMouseUp(i32x _iX,i32x _iY,i32x _iButton) {
  340.     var Gui_Component pthis; 
  341.     var Gui_dtEditBox pdtEditBox;
  342.  
  343.     // msg click send to parent
  344.     pthis = GetThis();
  345.     pdtEditBox = GetData(pthis);
  346.     if (pdtEditBox.iCursorEndSelect == pdtEditBox.iCursor) pdtEditBox.bClick = false;    
  347.     return 1;
  348. }
  349.  
  350. /*
  351.  *    Function        : EditBox Lose Focus callback
  352.  *    Remarks            : return true
  353.  */
  354. func i32x EditBox_OnLoseFocus()
  355. {
  356.     var Gui_Component pthis; 
  357.     var Gui_Component parent;
  358.  
  359.     pthis = GetThis();
  360.     parent = GetParent(pthis);
  361.     
  362.     // send mesg to parent
  363.     parent<<EbCLoseFocus();
  364.     return 1;
  365. }
  366.  
  367. /*
  368.  *    Function        : EditBox Gain Focus callback
  369.  *    Remarks            : return true
  370.  */
  371. func i32x EditBox_OnGainFocus()
  372. {
  373.     var Gui_Component pthis; 
  374.     var Gui_Component parent;
  375.  
  376.     pthis = GetThis();
  377.     parent = GetParent(pthis);
  378.  
  379.     // send mesg to parent
  380.     parent<<EbCGainFocus();
  381.     return 1;
  382. }
  383.  
  384. /*
  385.  *    Function        : EditBox Mouse click callback
  386.  *    Remarks            : Test left click
  387.  */
  388. func i32x EditBox_OnMouseClick(i32x _iX,i32x _iY,i32x _iButton)
  389. {
  390.     var Gui_Component pthis; 
  391.     var Gui_Component parent;
  392.     var Gui_dtEditBox pdtEditBox;
  393.  
  394.     if(_iButton == e_Gui_Mouse_Left_Button)
  395.     {
  396.         // msg click send to parent
  397.         pthis = GetThis();
  398.         parent = GetParent(pthis);
  399.         pdtEditBox = GetData(pthis);
  400.         if (pdtEditBox.bClick == false) {
  401.             parent<<EbCClick(_iX,_iY,_iButton);
  402.         }
  403.         else pdtEditBox.bClick = false;
  404.         return 1;
  405.     }
  406.     return 0;
  407. }
  408.  
  409. /*
  410.  *    Function        : EditBox Mouse double click callback
  411.  *    Remarks            : Test left click
  412.  */
  413. func i32x EditBox_OnMouseDblClick(i32x _iX,i32x _iY,i32x _iButton)
  414. {
  415.     var Gui_Component pthis; 
  416.     var Gui_Component parent;
  417.  
  418.     if(_iButton == e_Gui_Mouse_Left_Button)
  419.     {
  420.         // msg click send to parent
  421.         pthis = GetThis();
  422.         parent = GetParent(pthis);
  423.         parent<<EbCDblClick();
  424.         return 1;
  425.     }
  426.     return 0;
  427. }
  428.  
  429. /*
  430.  *    Function        : EditBox Key down callback
  431.  *    Remarks            : Test Key pressed
  432.  */
  433. func void EditBox_OnKeyDown(i32x _iKey, i32x _iCount) 
  434. {
  435.     var szx szTxt,szTxtTmp,szTxtTmp2;
  436.     var Gui_Component pthis;
  437.     var Gui_Component parent;
  438.     var Gui_dtEditBox pdtEditBox;
  439.     var i32x iLenghtTxt, iPosTxt;
  440.     var boolx bWrite, bInsert, bShift;
  441.     var i32x iMin, iMax;
  442.  
  443.     // on recupere les donnees du container actif
  444.     pthis = GetThis();
  445.     parent = GetParent(pthis);
  446.     pdtEditBox = GetData(pthis);
  447.  
  448.     // init
  449.     iLenghtTxt = strlen(pdtEditBox.szTxt);
  450.     iPosTxt = pdtEditBox.iCursor;
  451.     bInsert = pdtEditBox.bInsert;
  452.     szTxt = strncpy(pdtEditBox.szTxt,0,iLenghtTxt);
  453.     bWrite = true; // si α faux : ne pas effacer la selection dasn l'edit box, et ne rien ecrire au moment du OnChar
  454.     bShift = pdtEditBox.bShift;
  455.  
  456.     if (_iKey == VK_Shift) { // shift
  457.         bWrite = false;
  458.         bShift = true;
  459.     }
  460.     if (_iKey == VK_Left) { // left arrow
  461.         // on recule la position de notre curseur
  462.         if (bShift) {
  463.             if (pdtEditBox.iCursorEndSelect > 0) 
  464.                 parent<<EbCMoveCursorSelect(-1);
  465.         }
  466.         else { 
  467.             if (iPosTxt > 0) 
  468.                 parent<<EbCMoveCursor(-1);
  469.         }
  470.         bWrite = false;
  471.     }
  472.     if (_iKey == VK_Right) { // right arrow
  473.         // on avance la position de notre curseur si on n'est pas dΘjα au bout du texte
  474.         if (bShift) {
  475.             if (iLenghtTxt > pdtEditBox.iCursorEndSelect) 
  476.                 parent<<EbCMoveCursorSelect(1);
  477.         }
  478.         else {
  479.             if (iLenghtTxt > iPosTxt)
  480.                 parent<<EbCMoveCursor(1);
  481.         }
  482.         bWrite = false;
  483.     }
  484.     if (_iKey == VK_Return  || _iKey==VK_Tab) { // enter or tab
  485.         if (pdtEditBox.iType != e_GUI_EditBox_Chat) { 
  486.             // save data
  487.             parent<<EbCSaveData(szTxt,e_GUI_EditBox_Change_True);
  488.             bWrite = false;
  489.         }
  490.     }
  491.     if (_iKey == VK_Insert) { // insert
  492.         if (bInsert == false) bInsert = true;
  493.         else bInsert = false;
  494.     }
  495.     if (_iKey >= VK_F1 && _iKey <= VK_F12) { // les touches F1 α F12 
  496.         bWrite = false;
  497.     }
  498.     if ((pdtEditBox.iType == e_GUI_EditBox_CharOnly) 
  499.             && ((_iKey >= VK_0 && _iKey <= VK_9) 
  500.                 || (_iKey >= VK_Numpad0 && _iKey <= VK_Numpad9))) { // les touches numeriques alors qu'on est en CharOnly
  501.         bWrite = false;
  502.     }
  503.  
  504.     if (pdtEditBox.iCursorEndSelect != iPosTxt && bWrite == true) { // delete text select in edit box
  505.         if (pdtEditBox.iCursorEndSelect < iPosTxt) {
  506.             iMin = pdtEditBox.iCursorEndSelect;
  507.             iMax = iPosTxt;
  508.         }
  509.         else {
  510.             iMax = pdtEditBox.iCursorEndSelect;
  511.             iMin = iPosTxt;
  512.         }
  513.         // on efface le texte selectionnΘ
  514.         szTxtTmp = strncpy(szTxt,0,iMin);
  515.         szTxtTmp2 = strncpy(szTxt,iMax,iLenghtTxt);
  516.         szTxt = strcat(szTxtTmp,szTxtTmp2);
  517.         // on recule la position de notre curseur
  518.         parent<<EbCMoveCursor(iMin-iPosTxt);
  519.         // on ecrit le nouveau texte
  520.         EditBox_SetText(pthis,pdtEditBox,szTxt);
  521.     }
  522.     else { // if no text select
  523.         if (_iKey == VK_Back) { // backspace 
  524.             // si il reste plus d'une lettre
  525.             if (iPosTxt > 0 && iLenghtTxt > 1) {
  526.                 // on efface le texte au niveau du curseur
  527.                 szTxtTmp = strncpy(szTxt,0,(iPosTxt-1));
  528.                 szTxtTmp2 = strncpy(szTxt,iPosTxt,iLenghtTxt);
  529.                 szTxt = strcat(szTxtTmp,szTxtTmp2);
  530.                 // on recule la position de notre curseur
  531.                 parent<<EbCMoveCursor(-1);
  532.             }
  533.             // sinon
  534.             else if (iLenghtTxt < 2) {
  535.                 szTxt = " ";        
  536.                 if (iPosTxt != 0) parent<<EbCMoveCursor(-1);
  537.             }
  538.             // on ecrit le nouveau texte
  539.             EditBox_SetText(pthis,pdtEditBox,szTxt);
  540.             bWrite = false;
  541.         }
  542.         if (_iKey == VK_Delete || (bInsert == true && _iKey >= VK_0 && _iKey <= VK_Divide)) { // del or insert mode
  543.             // si il reste plus d'une lettre
  544.             if (iPosTxt < iLenghtTxt) {
  545.                 // si il n'y a plus qu'une lettre
  546.                 if (iLenghtTxt == 1) {            
  547.                     szTxt = " ";
  548.                 }
  549.                 else {
  550.                     // on efface le texte au niveau du curseur
  551.                     szTxtTmp = strncpy(szTxt,0,iPosTxt);
  552.                     szTxtTmp2 = strncpy(szTxt,(iPosTxt+1),(iLenghtTxt-1));
  553.                     szTxt = strcat(szTxtTmp,szTxtTmp2);
  554.                 }
  555.                 // on ecrit le nouveau texte
  556.                 EditBox_SetText(pthis,pdtEditBox,szTxt);
  557.             }
  558.         }
  559.     }
  560.  
  561.     pdtEditBox.bInsert = bInsert;
  562.     pdtEditBox.bWrite = bWrite;
  563.     pdtEditBox.bShift = bShift;
  564. }
  565.  
  566. /*
  567.  *    Function        : EditBox key pressed callback
  568.  *    Remarks            : Test if write == true
  569.  */
  570. func void EditBox_OnChar(szx _szChar,i32x _iCount)
  571. {
  572.     var szx szTxtTmp, szTxtTmp2, szTxt;
  573.     var Gui_Component pthis; 
  574.     var Gui_Component parent; 
  575.     var Gui_dtEditBox pdtEditBox;
  576.     var i32x iLenghtTxt, iPosTxt;
  577.  
  578.     // on recupere les donnees du container actif
  579.     pthis = GetThis();
  580.     parent = GetParent(pthis);
  581.     pdtEditBox = GetData(pthis);
  582.  
  583.     // test au cas o∙ on aurait appuyΘ sur une touche caracteres alors qu'on est en Numeric
  584.     if (pdtEditBox.iType == e_GUI_EditBox_Numeric) { 
  585.         if (strcmp(_szChar,"0")!=0 
  586.             && strcmp(_szChar,"1")!=0
  587.             && strcmp(_szChar,"2")!=0
  588.             && strcmp(_szChar,"3")!=0
  589.             && strcmp(_szChar,"4")!=0
  590.             && strcmp(_szChar,"5")!=0
  591.             && strcmp(_szChar,"6")!=0
  592.             && strcmp(_szChar,"7")!=0
  593.             && strcmp(_szChar,"8")!=0
  594.             && strcmp(_szChar,"9")!=0
  595.             && strcmp(_szChar,".")!=0
  596.             && strcmp(_szChar,"-")!=0) 
  597.             pdtEditBox.bWrite = false;
  598.     }
  599.     // init
  600.     iLenghtTxt = strlen(pdtEditBox.szTxt);
  601.     iPosTxt = pdtEditBox.iCursor;
  602.     szTxt = strncpy(pdtEditBox.szTxt,0,iLenghtTxt);
  603.  
  604.     if (pdtEditBox.bWrite && iLenghtTxt < pdtEditBox.iMaxChar) { // if not backspace
  605.         // on recupere tout le texte jusqu'a la position de notre curseur
  606.         szTxtTmp = strncpy(szTxt,0,iPosTxt);
  607.         szTxtTmp = strcat(szTxtTmp,_szChar);
  608.         // si la taille du texte est plus grande que la valeur de la position de notre curseur
  609.         // alors il ya du texte α remettre
  610.         if (iLenghtTxt > iPosTxt) {
  611.             szTxtTmp2 = strncpy(szTxt,iPosTxt,iLenghtTxt);
  612.             szTxtTmp = strcat(szTxtTmp,szTxtTmp2);
  613.         }
  614.         // on ecrit le nouveau texte
  615.         EditBox_SetText(pthis,pdtEditBox,szTxtTmp);
  616.         // on avance notre curseur
  617.         parent<<EbCMoveCursor(1);
  618.     }
  619. }
  620.  
  621. /////////////////////////////////////////// END EVENT EDIT BOX /////////////////////////////
  622.  
  623.  
  624. /////////////////////////////////////////// EVENT EDIT BOX COMPOSITE /////////////////////////////
  625.  
  626. /*
  627.  *    Function        : EditBoxComposite mouse click callback
  628.  */
  629. func void EditBoxComposite_OnClick(i32x _iX,i32x _iY,i32x _iButton) {
  630.     var Gui_Component pthis; 
  631.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  632.     var Gui_dtEditBox pdtEditBox;
  633.     var i32x iCase, iLenghtTxt, iWidth, iWidthNext,iSign;
  634.     var f32x factor;
  635.  
  636.     // on recupere les donnees du container actif
  637.     pthis = GetThis();
  638.     pdtEditBoxComposite = GetData(pthis);
  639.     pdtEditBox = GetData(pdtEditBoxComposite.gcEditBox);
  640.  
  641.     // calcul du nombre de case α se dΘplacer
  642.     factor = pdtEditBoxComposite.fFontFactor;
  643.     iCase = pdtEditBox.iCursor;
  644.     iWidthNext = 0.5 + (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,iCase,1)) / 2.0) * factor;
  645.     _iX = _iX-(AbsPosX(pdtEditBoxComposite.gcCursor)+iWidthNext);
  646.     if (_iX < 0) {
  647.         _iX = abs(_iX) - iWidthNext;
  648.         iWidthNext = 0.5 + (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,(iCase-1),1)) / 2.0) * factor;
  649.         _iX = _iX - iWidthNext;
  650.         iSign = -1;
  651.     }
  652.     else iSign =1;
  653.  
  654.     // boucle jusqu'α se qu'on dΘpasse la position du curseur
  655.     while (_iX > 0) {
  656.         iCase = iCase + iSign;
  657.         iWidth = iWidthNext;
  658.         iWidthNext = 0.5 + (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,iCase,1)) / 2.0) * factor;
  659.         _iX = _iX - iWidth - iWidthNext;
  660.     }
  661.  
  662.     // dΘplacement en fonction d'o∙ on a cliquΘ
  663.     iLenghtTxt = strlen(pdtEditBox.szTxt);
  664.     if (iCase > iLenghtTxt) {
  665.         pthis<<EbCMoveCursor(iLenghtTxt-pdtEditBox.iCursor);
  666.     }
  667.     else if (iCase >= 0)
  668.         pthis<<EbCMoveCursor(iCase-pdtEditBox.iCursor);
  669.  }
  670.  
  671. /*
  672.  *    Function        : EditBox mouse double click callback
  673.  */
  674. func void EditBoxComposite_OnMouseDblClick() {
  675.     var Gui_Component pthis; 
  676.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  677.     var Gui_dtEditBox pdtEditBox;
  678.     
  679.     // on recupere les donnees du container actif
  680.     pthis = GetThis();
  681.     pdtEditBoxComposite = GetData(pthis);
  682.     pdtEditBox = GetData(pdtEditBoxComposite.gcEditBox);
  683.  
  684.     // booleen click = true pour indiquer qu'il y a une selection
  685.     pdtEditBox.bClick = true;
  686.     // on ramene le curseur au debut de l'edit box
  687.     pthis<<EbCMoveCursor(-pdtEditBox.iCursor);
  688.     // on selectionne tout
  689.     pthis<<EbCMoveCursorSelect(strlen(pdtEditBox.szTxt));
  690. }
  691.  
  692. /*
  693.  *    Function        : lose focus EditBox => hide caption
  694.  */
  695. func void EditBoxComposite_OnLoseFocus()
  696. {
  697.     var Gui_Component pthis; 
  698.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  699.     var Gui_dtEditBox pdtEditBox;
  700.  
  701.     // on recupere les donnees du container actif
  702.     pthis = GetThis();
  703.     pdtEditBoxComposite = GetData(pthis);
  704.     pdtEditBoxComposite.gcCursor<<Hide();
  705. //    pdtEditBoxComposite.gcTexture<<Hide();
  706.     pdtEditBoxComposite.iFocused = 0;
  707.     pdtEditBox = GetData(pdtEditBoxComposite.gcEditBox);
  708.     pthis<<EbCSaveData(pdtEditBox.szTxt,e_GUI_EditBox_Change_False);
  709.     // Reset horizontal align
  710.     SetAlign(pdtEditBoxComposite.gcEditBox,pdtEditBoxComposite.iHAlign,pdtEditBoxComposite.iVAlign);
  711. }
  712.  
  713. /*
  714.  *    Function        : gain focus EditBox => show caption
  715.  */
  716. func void EditBoxComposite_OnGainFocus() {
  717.     var Gui_Component pthis; 
  718.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  719.  
  720.     // on recupere les donnees du container actif
  721.     pthis = GetThis();
  722.     pdtEditBoxComposite = GetData(pthis);
  723.     pdtEditBoxComposite.gcCursor<<Show();
  724. //    if(GetColor(pdtEditBoxComposite.gcTexture) != 0)
  725. //        pdtEditBoxComposite.gcTexture<<Show();
  726.     pdtEditBoxComposite.iFocused = 1;
  727.     // Set horizontal align
  728.     SetAlign(pdtEditBoxComposite.gcEditBox,e_GUI_HAlign_Left,e_GUI_VAlign_Center);
  729. }
  730.  
  731.  
  732. /*
  733.  *    Function        : EditBox Mouse Move callback (only if mouse click is down)
  734.  */
  735. func void EditBoxComposite_OnMouseMove(i32x _iX, i32x _iY) {
  736.     var Gui_Component pthis; 
  737.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  738.     var Gui_dtEditBox pdtEditBox;
  739.     var i32x iCase, iLenghtTxt, iPos, iWidth, iWidthNext, iSizeX, iSign;
  740.     var f32x factor;
  741.  
  742.     // on recupere les donnees du container actif
  743.     pthis = GetThis();
  744.     pdtEditBoxComposite = GetData(pthis);
  745.     pdtEditBox = GetData(pdtEditBoxComposite.gcEditBox);
  746.  
  747.     // calcul de la largeur du curseur
  748.     iSizeX = SizeX(pdtEditBoxComposite.gcCursor);
  749.  
  750.     // calcul du deplacement de la souris par rapport au curseur
  751.     factor = pdtEditBoxComposite.fFontFactor;
  752.     iCase = pdtEditBox.iCursorEndSelect;
  753.     iWidthNext = 0.5 + (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,iCase,1)) / 2.0) * factor;
  754.     _iX = _iX-(AbsPosX(pdtEditBoxComposite.gcCursor)+iWidthNext+iSizeX);
  755.  
  756.     if (_iX < 0) { // si on a reculΘ par rapport au curseur
  757.         _iX = abs(_iX) - iWidthNext;
  758.         iWidthNext = 0.5 + (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,(iCase-1),1)) / 2.0) * factor;
  759.         _iX = _iX - iWidthNext;
  760.         iSign = -1;
  761.     }
  762.     else iSign = 1;
  763.  
  764.     // calcul du nombre de case qui separe notre curseur du dΘplacement de la souris 
  765.     while (_iX > 0) {
  766.         iCase = iCase + iSign;
  767.         iWidth = iWidthNext;
  768.         iWidthNext = 0.5 + (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,iCase,1)) / 2.0) * factor;
  769.         _iX = _iX - iWidth - iWidthNext;
  770.     }
  771.     
  772.     // on dΘplace le curseur
  773.     iLenghtTxt = strlen(pdtEditBox.szTxt);
  774.     if (iCase > iLenghtTxt) 
  775.         pthis<<EbCMoveCursorSelect(iLenghtTxt-pdtEditBox.iCursorEndSelect);
  776.     else if (iCase >= 0)
  777.         pthis<<EbCMoveCursorSelect(iCase-pdtEditBox.iCursorEndSelect);
  778. }
  779.  
  780. /////////////////////////////////////////// END EVENT EDIT BOX COMPOSITE /////////////////////////////
  781.  
  782.  
  783. /////////////////////////////////////////// FUNC EDIT BOX /////////////////////////////
  784.  
  785. /*
  786.  *    Function        : write text in EditBox 
  787.  */
  788. func void EditBox_SetText(Gui_Component _pthis, Gui_dtEditBox _pdtEditBox, szx _szTxt)
  789. {
  790.     var Menu_Sprite msSprite;
  791.  
  792.     // text -> sprite
  793.     msSprite = GetSprite(_pthis);
  794.     
  795.     SetText(msSprite,_szTxt);
  796.  
  797.     // text -> edit box class
  798.     _pdtEditBox.szTxt = strncpy(_szTxt,0,strlen(_szTxt));
  799. }
  800.  
  801. func szx EditBox_GetText(Gui_Component _pComponent) 
  802. {
  803.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  804.     var Gui_dtEditBox pdtEditBox;
  805.  
  806.     // get Data
  807.     pdtEditBoxComposite = GetData(_pComponent);
  808.     pdtEditBox = GetData(pdtEditBoxComposite.gcEditBox);
  809.  
  810.     return (pdtEditBox.szTxt);
  811. }
  812.  
  813. /////////////////////////////////////////// END FUNC EDIT BOX /////////////////////////////
  814.  
  815.  
  816. /////////////////////////////////////////// MSG EDIT BOX //////////////////////////////////
  817.  
  818. /*
  819.  *    Function        : write text in EditBox 
  820.  *  Remarks : call this function with message EbText (message only call when we wish put a new text)
  821.  */
  822. func void EditBox_Text(szx _szTxt) {
  823.     var Gui_Component pthis, parent;
  824.     var Gui_dtEditBox pdtEditBox;
  825.  
  826.     pthis = GetThis();
  827.     parent = GetParent(pthis);
  828.     pdtEditBox = GetData(pthis);
  829.  
  830.     // move cursor at the begin of word
  831.     pdtEditBox.iCursor = 0;
  832.  
  833.     // set the text
  834.     EditBox_SetText(pthis,pdtEditBox,_szTxt);
  835. }
  836.  
  837. /*
  838.  *    Function        : change edit box type
  839.  */
  840. func void EditBox_ChangeType(i32x _iType) {
  841.     var Gui_Component pthis;
  842.     var Gui_dtEditBox pdtEditBox;
  843.  
  844.     pthis = GetThis();
  845.     pdtEditBox = GetData(pthis);
  846.     pdtEditBox.iType = _iType;
  847. }
  848.  
  849. /*
  850.  *    Function        : change number of character accepted in edit box
  851.  */
  852. func void EditBox_NbCharAccepted(i32x _iSize) {
  853.     var Gui_Component pthis;
  854.     var Gui_dtEditBox pdtEditBox;
  855.  
  856.     pthis = GetThis();
  857.     pdtEditBox = GetData(pthis);
  858.     pdtEditBox.iMaxChar = _iSize;
  859. }
  860.  
  861. /*
  862.  *    Function        : change size of edit box
  863.  */
  864. func void EditBox_Resize(i32x _iX, i32x _iY) {
  865.     var Gui_Component pthis;
  866.  
  867.     pthis = GetThis();
  868.     StretchTo(pthis,_iX,_iY);
  869. }
  870.  
  871.  
  872. ///////////////////////////////////////END MSG EDIT BOX /////////////////////////////
  873.  
  874.  
  875. /////////////////////////////////////////// MSG EDIT BOX COMPOSITE /////////////////////////////
  876.  
  877. /*
  878.  *    Function        : save data
  879.  */
  880. func void EditBoxComposite_SaveData(szx _szTxt, i32x _iChangeBox) {
  881.     var Gui_Component parent;
  882.     var Gui_Component pthis;
  883.  
  884.     pthis = GetThis();
  885.     parent = GetParent(pthis);
  886.     parent<<SaveData(pthis,_szTxt,_iChangeBox);
  887. }
  888.  
  889. /*
  890.  *    Function        : write text in EditBox 
  891.  *  Remarks : call this function with message EbCText (message only call when we wish put a new text)
  892.  */
  893. func void EditBoxComposite_Text(szx _szTxt)
  894. {
  895.     var Gui_Component pthis;
  896.     var Gui_dtEditBoxComposite pdtEditBox;
  897.  
  898.     pthis = GetThis();
  899.     pdtEditBox = GetData(pthis);
  900.  
  901.     // move cursor at the begin of EditBox
  902.     Move(pdtEditBox.gcCursor,-RelPosX(pdtEditBox.gcCursor),0);
  903.  
  904.     // Set Text
  905.     pdtEditBox.gcEditBox<<EbText(_szTxt);
  906.  
  907.     // move at the end of text
  908.     pthis<<EbCMoveCursor(strlen(_szTxt));
  909. }
  910.  
  911. /*
  912.  *    Function        : change edit box type
  913.  */
  914. func void EditBoxComposite_ChangeType(i32x _iType) {
  915.     var Gui_Component pthis;
  916.     var Gui_dtEditBoxComposite pdtEditBox;
  917.  
  918.     pthis = GetThis();
  919.     pdtEditBox = GetData(pthis);
  920.     pdtEditBox.gcEditBox<<EbChangeType(_iType);
  921. }
  922.  
  923. /*
  924.  *    Function        : change number of character accepted in edit box
  925.  */
  926. func void EditBoxComposite_NbCharAccepted(i32x _iSize) {
  927.     var Gui_Component pthis;
  928.     var Gui_dtEditBoxComposite pdtEditBox;
  929.  
  930.     pthis = GetThis();
  931.     pdtEditBox = GetData(pthis);
  932.     pdtEditBox.gcEditBox<<EbNbCharAccepted(_iSize);
  933. }
  934.  
  935. /*
  936.  *    Function        : change size of edit box
  937.  */
  938. func void EditBoxComposite_Resize(i32x _iX, i32x _iY) {
  939.     var Gui_Component pthis;
  940.     var Gui_dtEditBoxComposite pdtEditBox;
  941.  
  942.     pthis = GetThis();
  943.     pdtEditBox = GetData(pthis);
  944.     StretchTo(pthis,_iX,_iY);
  945.     // resize texture
  946.     StretchTo(pdtEditBox.gcTexture,_iX,_iY);
  947.     // resize editbox
  948.     pdtEditBox.gcEditBox<<EbResize(_iX,_iY);
  949. }
  950.  
  951. /*
  952.  *    Function        : change alignement of edit box
  953.  */
  954. func void EditBoxComposite_Align(i32x _eHAlign, i32x _eVAlign)
  955. {
  956.     var Gui_Component pthis;
  957.     var Gui_dtEditBoxComposite pdtEditBox;
  958.  
  959.     pthis = GetThis();
  960.     pdtEditBox = GetData(pthis);
  961.     // Change default align
  962.     pdtEditBox.iHAlign = _eHAlign;
  963.     pdtEditBox.iVAlign = _eVAlign;
  964.  
  965.     // Change align if not focused
  966.     if(pdtEditBox.iFocused == 0)
  967.     {
  968.         SetAlign(pdtEditBox.gcEditBox,_eHAlign,_eVAlign);
  969.     }
  970. }
  971.  
  972. /*
  973.  *    Function        : change color of edit box
  974.  */
  975. func void EditBoxComposite_ChangeColor(i32x _iColor)
  976. {
  977.     var Gui_Component pthis;
  978.     var Gui_dtEditBoxComposite pdtEditBox;
  979.  
  980.     pthis = GetThis();
  981.     pdtEditBox = GetData(pthis);
  982.  
  983.     // Change default color
  984.     SetColor(pdtEditBox.gcTexture,_iColor);
  985. }
  986.  
  987.  
  988. /*
  989.  *    Function        : move cursor
  990.  */
  991. func void EditBoxComposite_MoveCursor(i32x _iCase) {
  992.     var Gui_Component pthis;
  993.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  994.     var Gui_dtEditBox pdtEditBox;
  995.     var i32x iMove, iStart, iSign;
  996.     var f32x factor;
  997.  
  998.     // on recupere les donnees du container actif
  999.     pthis = GetThis();
  1000.     pdtEditBoxComposite = GetData(pthis);
  1001.     pdtEditBox = GetData(pdtEditBoxComposite.gcEditBox);
  1002.  
  1003.     if (_iCase != 0) {
  1004.         if (_iCase > 0) {
  1005.             iSign = 1;
  1006.             iStart = pdtEditBox.iCursor;
  1007.         }
  1008.         else {
  1009.             iStart = pdtEditBox.iCursor + _iCase;
  1010.             iSign = -1;
  1011.         }
  1012.         // calcul de la distance α parcourir avec le curseur
  1013.         factor = pdtEditBoxComposite.fFontFactor;
  1014.         iMove = iSign * (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,iStart,abs(_iCase))) * factor + 0.5);
  1015.         // on deplace le curseur dans la structure
  1016.         pdtEditBox.iCursor = pdtEditBox.iCursor + _iCase;
  1017.     }
  1018.     else iMove = 0;
  1019.     // on enleve la selection au cas o∙ il y en avait une
  1020.     pdtEditBox.iCursorEndSelect = pdtEditBox.iCursor;
  1021.     // on redimensionne le curseur α sa taille par dΘfaut
  1022.     StretchTo(pdtEditBoxComposite.gcCursor,pdtEditBoxComposite.iLenghtCursor,pdtEditBoxComposite.iHeightCursor);
  1023.     // on deplace le curseur α l'ecran
  1024.     Move(pdtEditBoxComposite.gcCursor,iMove,0);
  1025. }
  1026.  
  1027. /*
  1028.  *    Function        : move cursor select
  1029.  */
  1030. func void EditBoxComposite_MoveCursorSelect(i32x _iCase) {
  1031.     var Gui_Component pthis;
  1032.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  1033.     var Gui_dtEditBox pdtEditBox;
  1034.     var i32x iMove, iStart, iSign, iSizeX;
  1035.     var f32x factor;
  1036.  
  1037.     // on recupere les donnees du container actif
  1038.     pthis = GetThis();
  1039.     pdtEditBoxComposite = GetData(pthis);
  1040.     pdtEditBox = GetData(pdtEditBoxComposite.gcEditBox);
  1041.  
  1042.     if (_iCase >= 0) {
  1043.             iStart = pdtEditBox.iCursorEndSelect;
  1044.             iSign = 1;
  1045.     }
  1046.     else {
  1047.         iStart = pdtEditBox.iCursorEndSelect + _iCase;
  1048.         iSign = -1;
  1049.     }
  1050.     // calcul de la distance α couvrir
  1051.     factor = pdtEditBoxComposite.fFontFactor;
  1052.     iMove = SizeX(pdtEditBoxComposite.gcCursor) +
  1053.             (iSign * (PrecalcTextWidth(GetSprite(pdtEditBoxComposite.gcEditBox),strncpy(pdtEditBox.szTxt,iStart,abs(_iCase))) * factor + 0.5));
  1054.     // on deplace le curseur de selection dans la structure
  1055.     pdtEditBox.iCursorEndSelect = pdtEditBox.iCursorEndSelect + _iCase;
  1056.  
  1057.     // on etire le curseur
  1058.     StretchTo(pdtEditBoxComposite.gcCursor,iMove,pdtEditBoxComposite.iHeightCursor);
  1059. }
  1060.  
  1061. func void EditBoxComposite_OnEnable()
  1062. {
  1063.     var Gui_Component pthis;
  1064.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  1065.  
  1066.     // on recupere les donnees du container actif
  1067.     pthis = GetThis();
  1068.     pdtEditBoxComposite = GetData(pthis);
  1069.     // Update background color
  1070.     SetColor(pdtEditBoxComposite.gcTexture,cEBColor);
  1071. }
  1072. func void EditBoxComposite_OnDisable()
  1073. {
  1074.     var Gui_Component pthis;
  1075.     var Gui_dtEditBoxComposite pdtEditBoxComposite;
  1076.  
  1077.     // on recupere les donnees du container actif
  1078.     pthis = GetThis();
  1079.     pdtEditBoxComposite = GetData(pthis);
  1080.     // Update background color
  1081.     SetColor(pdtEditBoxComposite.gcTexture,cEBDisableColor);
  1082. }
  1083.  
  1084. /////////////////////////////////////////// END MSG EDIT BOX COMPOSITE /////////////////////////////
  1085.